Skip to content

Add unit test for .psis_subset() output structure#519

Open
utkarshpawade wants to merge 4 commits intostan-dev:masterfrom
utkarshpawade:test/psis-subset-unit-test
Open

Add unit test for .psis_subset() output structure#519
utkarshpawade wants to merge 4 commits intostan-dev:masterfrom
utkarshpawade:test/psis-subset-unit-test

Conversation

@utkarshpawade
Copy link
Copy Markdown
Contributor

Fixes #518

Summary

  • Adds a test verifying .psis_subset() preserves psis object structure (class, log_weights, diagnostics, dims, norm_const_log, tail_len, r_eff)
  • Acts as a canary if loo changes its psis internals

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (a86c556) to head (5979ec7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #519   +/-   ##
=======================================
  Coverage   98.67%   98.67%           
=======================================
  Files          35       35           
  Lines        5905     5905           
=======================================
  Hits         5827     5827           
  Misses         78       78           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings April 3, 2026 08:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a regression/unit test to ensure .psis_subset() returns a valid loo::psis object with expected internal structure, acting as a canary if loo changes psis internals.

Changes:

  • Added a new test verifying .psis_subset() output class, log_weights, diagnostics, and key attributes/dimensions.
  • Added a NEWS entry noting the new unit test.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/testthat/test-ppc-loo.R Adds a structure-focused unit test for .psis_subset() output.
NEWS.md Documents the addition of the new unit test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing unit test for .psis_subset() output structure

3 participants